refactor: native macOS patterns for keyboard nav, search fields, and resize handle#598
Merged
refactor: native macOS patterns for keyboard nav, search fields, and resize handle#598
Conversation
- SearchFieldView: resolve theme font size inside body for reactivity - HorizontalSplitView: refresh binding in updateNSView to prevent stale reference - HorizontalSplitView: add 0.5pt threshold to resize callback to reduce re-renders - HorizontalSplitView: remove redundant splitView.display() calls - ConnectionSwitcherPopover: extract moveSelection helper to avoid repeated allItems computation - ContentView: remove dead saveCurrentSessionState stub
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Three medium-effort audit fixes replacing custom implementations with native macOS patterns:
Connection Switcher keyboard nav — Replaced
NSEvent.addLocalMonitorForEvents(matching: .keyDown)with SwiftUI.onKeyPress()+.onExitCommand. Eliminates global key interception and manual install/teardown lifecycle. Pattern matchesQuickSwitcherViewwhich already does this correctly.Reusable SearchFieldView — Extracted identical HStack + magnifying glass + TextField + clear button pattern from 4 views into a single
SearchFieldViewcomponent. Reduces ~80 lines of duplicated code. WelcomeWindowView excluded (has extensive view-specific key handlers).Inspector panel resize — Replaced custom
PanelResizeHandle(DragGesture + manual NSCursor) withHorizontalSplitViewwrappingNSSplitView. Gains native divider cursor, autosave position, accessibility support, and proper drag feel. Pattern matches existingQuerySplitView.Test plan